"""
解方程 : ax2 + bx + c =0
"""

import math

def fun(a,b,c):
    deta = b**2 - 4*a*c
    if deta < 0:
        raise ValueError('No Solution!')
    return ( -b + math.sqrt(deta) ) / (2*a)  ,  ( -b - math.sqrt(deta) ) / (2*a)

print(fun(1,4,1))

# 复杂度 O(1) 
